1. Field of the Invention
The present invention relates to a storage system for copying data between a plurality of storage devices, a storage device in this system, a method of copying data between a plurality of storage devices, and a medium recording a program for copying data between a plurality of storage devices. In particular, the present invention relates to a case where a synchronous copy process and an asynchronous copy process coexist. The synchronous copy process is to copy in synchronization with I/O (hereinafter, referred to as host I/O) carried out by a host computer (hereinafter, referred to as a host) and, the asynchronous copy process is to copy in asynchronization with the host I/O.
2. Description of the Related Art
There are storage devices with the function to copy data between storage devices to make a backup copy for recovery in case physical disk failures or any other accidents should occur. This function is to copy data of a storage device (hereinafter, referred to as a master side device), to which a host is directly connected, to another storage device (hereinafter, referred to as a remote side device) which is connected indirectly to the host via the master side device and an interface cable. When data has been copied to the remote side device in advance for a backup and recovery, the system can be restored to continue the services even when the data of the master side device cannot be read due to a failure or the like of a physical disk, or the entire master side device fails due to an accident or the like.
The method of copying data between storage devices include a synchronous copy method of copying to a remote side device in synchronization with host I/O, and an asynchronous copy method of copying to a remote side device in asynchronization with the host I/O. In the synchronous copy method, at the time of a write request from the host, data is written to a volume of the master side device (hereinafter, referred to as a master volume) and concurrently, the same data is written to a volume of the remote side device (hereinafter, referred to as a copy volume). Then, after completing the writing at the remote side device, the master side device returns a completion response of the host I/O to the host. In this method, the contents of the master volume are always identical to those of the copy volume. This is the method used in a case where the latest data is at all times required when a failure occurs.
On the other hand, in the asynchronous copy method, a completion response of host I/O is returned to the host when data has been written to the master volume. Subsequently, the data is sent to the remote side device, and is written to the copy volume. Although this method causes a delay in making the data of the copy volume identical to that of the master volume, this is the method used in a system in which the above delay is allowed.
Japanese Patent Application No. 2003-6016 (hereinafter referred to as Patent Document 1) discloses that, in a state where asynchronous copy cannot be performed, copy to a logical volume with a high priority is continued, but copy to a logical volume with a low priority is halted.
In either case of the synchronous copy method or of the asynchronous copy method, when there is a space available in a cache memory of the remote side device, the completion response of copying is returned to the master side device when the data is written to the cache memory. Thereafter, the copy process is terminated.
However, when there is no space available in the cache memory of the remote side device, the remote side device firstly writes the data on the cache memory and has not been written to a physical disk, to the physical disk to make space available in the cache memory. Thereafter, the remote side device writes the data to this space in the cache memory, returns a completion response of copying to the master side device, and terminates the copy process.
Hereinafter, descriptions of the above process are provided with reference to FIG. 6. After a copy process is started in the remote side device, when there is a space available in the cache memory (YES at S601), the data is written to the cache memory (S603). Then a completion notification on the copying is sent to the master side device (S604).
When there is no space in the cache memory (NO at 601), the data, which has not been written to the physical disk among the data in the cache memory, is written to the physical disk (S602) to make space in the cache memory. Subsequently, the data is written to the cache memory (S663) and the completion notification on the writing is sent to the master side device (S604). In this case the completion notification on the copying is delayed because the data is written to the physical disk (S602). For this reason, the completion response of the host I/O, which is carrying out the synchronous copy process, to the host is also delayed.
Accordingly, in the case where the synchronous copy process and the asynchronous copy process coexist, there is a problem. The response of the synchronous copy process is delayed under the influence of the write load due to the asynchronous copy process. So the completion response of the host I/O, when carrying out the synchronous copy process, is also delayed. This problem has not been solved even by means of the technique disclosed in Patent Document 1 described above.